#include "fxcc/core/graph/common/Viewport.h"
#include "fxcc/core/graph/common/Config.h"

using namespace fxcc::graph::common;

glm::mat4 Viewport::GetOrthoMatrix() const
{
#ifdef FXCC_USE_LEFT_HAND
	return GetOrthoMatrixLH();
#else
	return GetOrthoMatrixRH();
#endif

}


void Viewport::SetHalfExtends(const glm::vec3& halfExtends)
{
	left = -halfExtends.x;
	right = halfExtends.x;
	top = halfExtends.y;
	bottom = -halfExtends.y;
	zNear = -halfExtends.z;
	zFar = halfExtends.z;
}

glm::mat4 Viewport::GetOrthoMatrixLH() const
{
	return glm::orthoLH(left, right, bottom, top, zNear, zFar);
}

glm::mat4 Viewport::GetOrthoMatrixRH() const
{
	return glm::orthoRH(left, right, bottom, top, zNear, zFar);
}